package com.panshi.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.panshi.entity.AppAnswerT;
import com.panshi.service.impl.AppAnswerTServiceImpl;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 回答表 前端控制器
 * </p>
 *
 * @author xhlMr
 * @since 2020-08-04
 */
@RestController
public class AppAnswerTController {

    @Autowired
    private AppAnswerTServiceImpl appAnswerTService;

    @ApiModelProperty("咨询全部内容")
    @GetMapping("/app-answer-t/all")
    public List<AppAnswerT> all(){
        return appAnswerTService.list(null);
    }

    @ApiModelProperty("咨询按id查询")
    @GetMapping("/app-answer-t/bymid/{id}")
    public AppAnswerT bymid(@PathVariable("id") Integer id){
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("matter_id", id);
        return appAnswerTService.getOne(wrapper);
    }
}

